package com.lottery.ruok.lottrey.adapter;

import android.content.Context;
import android.view.View;

import com.lottery.ruok.lottrey.adapter.recyclleradapter.BaseAppRecyclerViewAdapter;
import com.lottery.ruok.lottrey.retrofitModule.response.GetWholeCategoryResponse;
import com.lottery.ruok.lottrey.ui.component.HomeCPGroupView;

public class HomeCPAdapter extends BaseAppRecyclerViewAdapter<GetWholeCategoryResponse> {
    public HomeCPAdapter(Context context) {
        super(context);
    }

    public HomeCPGroupView.MoreBuyLotteryClickListener listener;
    @Override
    protected View createItemView(Context mContext, int viewType) {
        return new HomeCPGroupView(mContext);
    }

    @Override
    protected void onBindView(View itemView, int position) {
        if (itemView instanceof HomeCPGroupView) {
            HomeCPGroupView view = (HomeCPGroupView) itemView;
            view.setData(getList().get(position));
            view.setOnMoreBuyLotteryClickListener(listener);
        }
    }

    public void setOnMoreBuyLotteryClickListener(HomeCPGroupView.MoreBuyLotteryClickListener listener) {
        this.listener = listener;

    }
}
